<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="js/ajax.js"></script>
</head>

<body>
    <script>
        /* 
            服务端的URL： http://120.78.190.136:8088/spboot/jsonTest1

            通过Ajax访问出现错误：该资源不允许被ajax请求访问。
            from origin 'null' has been blocked by CORS policy: No 'Access-
            Control-Allow-Origin' header is present on the requested resource.
         */
        ajax({
            type: 'GET',
            url: 'http://120.78.190.136:8088/spboot/jsonTest1',
            success: function (data) {
                console.log(data);
            }
        });

    </script>
</body>

</html>